package com.chenguo.gulimall.auth;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/**
 * 核心原理
 *
 *  1.@enbleRedisHttpSession 导入 RedisHttpSessionConfiguration 配置
 *     1.给容器中添加一个组件
 *          SessionRepository =>>> 【RedisOperationsSessionRepository】==>redis操作session 增删改查
 *     2.SessionRepositoryFilter => session 过滤器 每个请求都需要经过filter
 *        1.创建的时候 就自动从容器中获取到了SessionRepository
 *        2.原始的request response 被包装 SessionRepositoryRequestWrapper
 *        3.以后获取session  都是从这个包装类里面获取的
 *
 *   自动过期  redis中数据也是有过期时间
 */



@EnableRedisHttpSession //springsession 使用redis 作为Session存储
@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
public class GulimallAuthServerApplication {
    public static void main(String[] args) {
        SpringApplication.run(GulimallAuthServerApplication.class,args);

    }
}
